﻿// --------------------------------------------------------------------------------------------------------------------- 
// <copyright file="Problem1.cs" company="Microsoft">
//   Copyright (c) Microsoft Corporation.  All rights reserved. THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
// </copyright>
// <summary>
//   Defines the Problem1 type.
// </summary>
// ---------------------------------------------------------------------------------------------------------------------
namespace EulerProblemsCSharp.Problems
{
    using System.Linq;

    /// <summary>
    /// Solution to Problem 1
    /// </summary>
    public class Problem1 : ProblemBase
    {
        /// <summary>
        /// Gets Number.
        /// </summary>
        /// <value>
        /// The number.
        /// </value>
        public override int Number
        {
            get
            {
                return 1;
            }
        }

        /// <summary>
        /// Gets Description.
        /// </summary>
        /// <value>
        /// The description.
        /// </value>
        public override string Description
        {
            get
            {
                return "Find the sum of all the multiples of 3 or 5 below 1000.";
            }
        }

        /// <summary>
        /// Solves problem.
        /// </summary>
        /// <returns>
        /// Solution for problem.
        /// </returns>
        public override object Solve()
        {
            var answer = Enumerable.Range(1, 999).Where(n => n % 3 == 0 || n % 5 == 0).Sum();   
            return answer;
        }
    }
}